﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Data.UserDb;

namespace Acc_Web
{
    public partial class Info : System.Web.UI.Page
    {

        protected Items item;
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!IsPostBack)
            {
                var reqItemId = Request["i"];
                if(String.IsNullOrEmpty(reqItemId))
                {
                    Response.Write("<script>alert('参数出错');history.back();</script>");
                    Response.End();
                    return;
                }
                var itemId = 0;
                Int32.TryParse(reqItemId,out itemId);
                if(itemId == 0)
                {
                    Response.Write("<script>alert('参数出错');history.back();</script>");
                    Response.End();
                    return;
                }

                var sr = new ShopRepository();
                item = sr.GetItemDetail(itemId);
                
            }
        }
    }
}
